//
//  ViewController.m
//  PigRefreshDemo
//
//  Created by boom on 2017/5/4.
//  Copyright © 2017年 boomLi. All rights reserved.
//

#import "ViewController.h"
#import "PigGifRefreshHeader.h"
#import "PigGifRefreshFooter.h"

@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //初始化一个UITableView
    UITableView* tableview = [[UITableView alloc] init];
    tableview.dataSource = self;
    tableview.delegate = self;
    tableview.frame = CGRectMake(0, 64, 375, 675);
    [tableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    tableview.backgroundColor = [UIColor greenColor];
    tableview.mj_footer = [PigGifRefreshFooter footerWithRefreshingBlock:^{
        NSLog(@".....................");
    }];
    tableview.mj_header = [PigGifRefreshHeader headerWithRefreshingBlock:^{
        NSLog(@"/////////////////////");
    }];
    [self.view addSubview:tableview];
}


#pragma -- UITableViewDataSource

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 20;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    return cell;
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 40;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
